package org.jeecg.modules.wlhy.utils;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.paycenter.enums.UTypeEnum;
import org.jeecg.modules.wlhy.complaint.service.IHyComplaintService;
import org.jeecg.modules.wlhy.hyproject.service.IHyProjectService;
import org.jeecg.modules.wlhy.order.vo.HyOrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.Date;

@Service
public class ProjectUtil {

    @Autowired
    private IHyProjectService hyProjectService;
    /**
     *  获取数据权限
     * @return
     */
    public  void setQueryWrapperByProject(String parm,QueryWrapper<?> queryWrapper){
        LoginUser loginUser = UserUtil.getLoginUser();
        String dataPermission = hyProjectService.getListById(loginUser.getId());
        if (dataPermission != null && dataPermission!="") {
            queryWrapper.in(parm, Arrays.asList(dataPermission.toString().split(",")));
        }
    }





}
